/*
 * CSStudent.cpp
 *
 *  Created on: Nov 13, 2012
 *      Author: naduvec
 */

#include "../include/CSStudent.h"
#include <stdio.h>
#include <iostream>
using namespace std;
	void CSStudent::study(Course &c)
	{
		bool fail=false;
		//treating not handling workload
		if(rand()%5>0)
		{
			cout<< ID <<" quit course "<< c.getName();
			fail=true;
		}
		else
		{//treating grade
			fail=treatGrade(c);
		}
		if(fail)
		{
			semester_succeed=false;
		}
		else		//pass
		{
			c.eraseRegStudent(this);
		}
	}
